package com.gunncs.actoriface;
import com.gunncs.actoriface.*;
import java.util.*;
public class PlanBActor{ /* implements Actor {
  public final int TOLERANCE = 5;
  public final int FARDIST = 1;
  public final int FARANGLE = 10;
  public final int NOTFARDIST = 10;
  public final int NOTFARANGLE = 3;
  public final int BACKDIST = 10;
  public final int NINETY = 90;
  public boolean far = false;
  public boolean wallTouch = false;
  public void act(Robot r) {
    if (wallTouch) {
      r.goBackward();
      r.waitDistance(BACKDIST);
      r.turnLeft();
      r.waitAngle(NINETY);
    } else if (far) {
      r.goForward();
      r.waitDistance(FARDIST);
      r.turnRight();
      r.waitAngle(FARANGLE);
    } else {
      r.goForward();
      r.waitDistance(NOTFARDIST);
      r.turnLeft();
      r.waitAngle(NOTFARANGLE);
    }
  }
  public void updateSensors(Sensor[] s) {
    if (s[5].getState() <= TOLERANCE) {
      far = false;
    } else if (s.[5].getState() > TOLERANCE) {
      far = true;
    }
    
    if (s[0].getState() == TOUCHINGWALL) {
      wallTouch = true;
    }  */
}